import { General } from '../models/General';
import { Effect,FormationType } from '../types';

export interface Team {
  id: string;
  generals: General[];
  formation: FormationType;
}

export interface BattleState {
  currentTurn: number;
  teams: [Team, Team];
  actionOrder: General[];
  isEnded: boolean;
  winner?: Team;
}

export interface TurnResult {
  turnNumber: number;
  timestamp: number;
  actions: BattleAction[];
  casualties: Map<string, number>;
  effects: Effect[];
}

export interface BattleAction {
  actor: General;
  target: General | General[];
  type: 'attack' | 'skill';
  skillId?: string;
  damage: number;
  effects?: Effect[];
  healing?: number;
  timestamp?: number;
  description?: string;
}

export interface BattleReport {
  winner?: Team;
  turns: TurnResult[];
  finalState: {
    remainingTroops: Map<string, number>;
    totalDamage: Map<string, number>;
    totalHealing: Map<string, number>;
  };
}
